<template>
  <!-- 原生的 -->
  <div class="hello">
    <input type="text" v-model="account" /><br />
    <input type="text" v-model="psw" /><br />
    <button @click="loginHandle()">登录按钮</button>
  </div>

  <!-- ui样式的  ant desigin vue -->
</template>

<script>
export default {
  name: "list",
  props: {
    // msg: String,
  },
  data() {
    return {
      account: "zhanghao",
      psw: "mima",
      tableData: [],
    };
  },

  methods: {
    loginHandle() {
      this.rq.get("/users").then((res) => {
        console.log(res, "res的数据"); //登陆成功以后把token存入storage和vuex

        localStorage.setItem("tokens", res.data[0].token);
        if (res) {
          this.$router.push({
            path: "/stulist",
            // query:{aa:xx, bb: xx}
          });
        }
      });
    },
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
</style>
